﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="email_space_list.aspx.cs" Inherits="Ccit.OA.Email.email_space_list" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v8.1" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v8.1" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>邮件空间设置</title>
<script language="javascript" src="../script/jquery.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jbase64.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jsonlib.js" type="text/javascript" ></script>
    <script language="javascript" src="../script/StringClass_Ext.js" type="text/javascript" ></script>
    <script language="javascript">

    function doSet()
    {
       var sId = document.getElementById("hidIds").value;
       if(sId == "")
       {
        alert('请先选择你要设置的用户!');
        return false;
       }
       popUp();
       return false;
    }
    
    function doSetAll()
    {
        if(confirm("确定重新设置所有员工邮箱空间?"))
        {
           
           grid.SelectAllRowsOnPage(this.checked);
           // document.getElementById("hidIds").value = "0";
            popUp();
            return false;
        }
        
       return false;
    }
    
    	function popUp() {
        newX = window.event.x + document.body.scrollLeft
        newY = window.event.y + document.body.scrollTop
        menu = document.getElementById("root");
          if ( menu.style.display == ""){
            menu.style.display = "none" }
          else {
             menu.style.display = ""}

            menu.style.pixelLeft = 300 //newX - 40
            menu.style.pixelTop = -300 //newY + 5
        }
    
        function popOver()
        {
            document.getElementById("root").style.display = "none";
        }
        
         function CliNumber(ContantName)
         {
            if(isNaN(document.getElementById(ContantName).value))
            {
                document.getElementById(ContantName).value = "";
                alert("只允许输入数字!");
            }
         }
    </script>
    
    <script type="text/javascript">
var ie=document.all;
var nn6=document.getElementById && !document.all;
var isdrag=false;
var x,y;
var dobj;

function movemouse(e)
{
if (isdrag)
{
dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
 return false;
}
}

function selectmouse(e)
{
var fobj       = nn6 ? e.target : event.srcElement;
  var topelement = nn6 ? "HTML" : "BODY";
  while (fobj.tagName != topelement  &&  fobj.className != "dragme")
  {
    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
  }
  if (fobj.className=="dragme")
  {
    isdrag = true;
    dobj = fobj;
    tx = parseInt(dobj.style.left+0);
    ty = parseInt(dobj.style.top+0);
    x = nn6 ? e.clientX : event.clientX;
    y = nn6 ? e.clientY : event.clientY;
    document.onmousemove=movemouse;
    return false;
  }

}
document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");
</script>
    
	<style type="text/css">
        a.           { font: 9pt "宋体"; cursor: hand; font-size: 9pt ; color: #ffffff; text-decoration: none }
        a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
        a.cc:hover   { font: 9pt "宋体"; cursor: hand; color: #FF0033}
        .box         { font: 9pt "宋体"; position: absolute;  background: #eee }
    .dragme{  font: 9pt "宋体"; position: absolute;  background: #eee ;position:relative;}
    </style>
    </head>
<body>
    <ccit:ActionForm id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
        <input type="hidden" id="hidIds" runat="server" />
         <table class="tbToolbar" cellpadding="0" border="0" cellspacing="0" width="98%" align="center">
            <tr valign="top">

               <td align="left" valign="middle">
                    <div class="tbSeparator"></div>
                </td>
                <td align="left" class="titlebar" valign="middle">
                <nobr>我的邮件-&gt;邮箱空间设置</nobr>
                </td>
                <td align="right" valign="middle">
                    <div class="tbSeparator"></div>
                </td>
                <td align="right">
                    <nobr>关键字<input runat="server" id="txtKeyword" class="input" style="width:80px;" /></nobr></td>
                <td align="right">
                    <nobr>
                        邮件空间<asp:DropDownList runat="server" id="ddEmlsign" >
                            <asp:ListItem  Value="">> </asp:ListItem>
                            <asp:ListItem  Value="">>= </asp:ListItem>
                            <asp:ListItem Value="">= </asp:ListItem>
                            <asp:ListItem Value="">< </asp:ListItem>
                            <asp:ListItem Value=""><= </asp:ListItem>
                        </asp:DropDownList>
                        <asp:TextBox runat="server" CssClass="input" MaxLength="5" ID="txtEmlsign" Width="46px"></asp:TextBox>M
                        使用空间<asp:DropDownList runat="server" id="ddyet" >
                            <asp:ListItem  Value="">> </asp:ListItem>
                            <asp:ListItem  Value="">>= </asp:ListItem>
                            <asp:ListItem Value="">= </asp:ListItem>
                            <asp:ListItem Value="">< </asp:ListItem>
                            <asp:ListItem Value=""><= </asp:ListItem>
                        </asp:DropDownList>
                        <asp:TextBox runat="server" CssClass="input" MaxLength="5" ID="txtyet" Width="46px"></asp:TextBox>M
                    </nobr>
                </td>

                <td align="right" width="120px" >
                    <nobr><asp:LinkButton ID="lbSel" CssClass="linktext" runat="server" onclick="lbSel_Click" ><IMG src="../images/toolbar/view.gif" align="middle" border="0">查询</asp:LinkButton> <asp:LinkButton CssClass="linktext" ID="lbSet" runat="server" ><IMG src="../images/toolbar/xxsbmit.GIF" align="middle" border="0">设置</asp:LinkButton><asp:LinkButton CssClass="linktext" ID="lbAllSet" runat="server" ><IMG src="../images/toolbar/xxsbmit.GIF" align="middle" border="0">设置全部</asp:LinkButton>
                    </nobr>   
                </td>
    
                <td align="right" valign="middle">
                    <div class="tbSeparator"></div>
                </td>
            </tr>
        </table>
        
        <table cellspacing="0" cellpadding="0" align="center" border="0"  style="WIDTH:98%;HEIGHT:441px">
			<tr height="100%" valign="top">
				<td>
                <dxwgv:ASPxGridView ID="grid" 
                             
                            Width="100%" 
                            AutoGenerateColumns="False" 
                            KeyFieldName="userid"
                            Settings-ShowFooter="false"
                            runat="server" onhtmlrowcreated="grid_HtmlRowCreated" EnableCallBacks="false">
                         
              <Columns>
              
              <dxwgv:GridViewDataTextColumn Caption="" FieldName="userid" Visible="false" ShowInCustomizationForm="false" VisibleIndex="1"></dxwgv:GridViewDataTextColumn>
                 
                             <%-- 复选框选择--%>
                <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Width="3%">
                        <HeaderTemplate>
                            <input id="chkCheck" class="checkbox" type="checkbox" runat="server" onclick="grid.SelectAllRowsOnPage(this.checked);" style="vertical-align:middle;" title="Select/Unselect all rows on the page"></input>
                        </HeaderTemplate>
                        <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" HorizontalAlign="Center">
                            <Paddings PaddingTop="1px" PaddingBottom="1px"></Paddings>
                        </HeaderStyle>
                    </dxwgv:GridViewCommandColumn>
                      
                <dxwgv:GridViewDataTextColumn Caption="姓名" FieldName="username" VisibleIndex="3" Width="10%">
                    <HeaderStyle HorizontalAlign="center" />
                    <CellStyle HorizontalAlign="Left"></CellStyle>
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="所属部门" FieldName="deptname" VisibleIndex="4" Width="15%"  >
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Left"></CellStyle>
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="职位" FieldName="postionname" VisibleIndex="5" Width="15%">
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Left"></CellStyle>
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="邮件空间" FieldName="spacesize" VisibleIndex="6" Width="12%">
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Left"></CellStyle>
                </dxwgv:GridViewDataTextColumn>  
                <dxwgv:GridViewDataTextColumn Caption="已使用空间" FieldName="yyspace" VisibleIndex="7" Width="12%">
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Left"></CellStyle>
                </dxwgv:GridViewDataTextColumn> 
                <dxwgv:GridViewDataTextColumn Caption="剩余空间" FieldName="remain"  VisibleIndex="8" Width="12%">
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Left"></CellStyle>
                </dxwgv:GridViewDataTextColumn> 
                    </Columns>
            
            
             
            <%-- 设置页脚中分页 --%>
            <SettingsPager PageSize=13 Mode="ShowPager" AlwaysShowPager=true
                 FirstPageButton-Visible=true LastPageButton-Visible=true  
                 FirstPageButton-Image-AlternateText="" LastPageButton-Image-AlternateText="尾页"
                 NumericButtonCount=5  SEOFriendly="CrawlerOnly"
                 PrevPageButton-Visible="true" NextPageButton-Visible="true"
                 ShowSeparators=true Position="Bottom">
                    <FirstPageButton Visible="True"></FirstPageButton>
                    <LastPageButton Visible="True">
                    <Image AlternateText="尾页"></Image>
                    </LastPageButton>
            </SettingsPager>
                 
            <%-- 复选框选择脚本事件--%>
            <ClientSideEvents SelectionChanged="function(s,e){OnGridSelectionChanged();}"
                 CustomizationWindowCloseUp="function(s,e){ UpdateCustomizationWindowValue();}"
             />
            
            <%-- 设置行样式--%>
            <Styles>
                <Row CssClass=""></Row>
                <AlternatingRow  CssClass="" Enabled="true"/>
                <SelectedRow  CssClass=""></SelectedRow>                
            </Styles>
            <%--  显示过滤行--%>
            <Settings ShowFilterRow="false" ShowPreview="True"/>
            
            <%-- 可调整列宽--%>
            <SettingsBehavior ColumnResizeMode="Control" />
            
            <%-- 自定义表头--%>
            <SettingsCustomizationWindow Enabled="true" />
        </dxwgv:ASPxGridView>
        </td>
      </tr>
    </table>
    <div id="root" class="dragme"  style="display : none;width:200px; height:80px;">
		<table id="menuTable" style="border:#999999 solid; width:200px; height:80px;border-width:1 1 1 1" cellSpacing="0" cellPadding="0">
		    <tr>
		        <td valign="middle" align="right">
		            空间大小
		        </td>
		        <td>
		            <input type="text" runat="server" class="input" style="width:80px;" id="txtSetSpace" maxlength="3" />M
		        </td>
		    </tr>
		    <tr>
		        <td valign="middle" align="center" colspan="2">
		        <asp:Button CssClass="button"  runat="server" ID="btSet" Text="确定" 
                        onclick="btSet_Click"/>
		           <input type="button" class="button" id="btCancel" onclick="popOver();" value="取消" />
		        </td>
		    </tr>
		</table>
    </div>
    
    		 <script language="javascript" type="text/javascript">
            <!--
            /* 复选框选择 */
            function OnGridSelectionChanged(){
                grid.GetSelectedFieldValues("userid",OnGridSelectionComplete);
            }
            
            function OnGridSelectionComplete(values){
                document.getElementById("hidIds").value = values;
            }
            
            //-->
        </script>
    </ccit:ActionForm>
</body>
</html>
